//
//  MOProdectHeadView.m
//  FastDoctor
//
//  Created by 冯龙飞 on 16/5/21.
//  Copyright © 2016年 冯龙飞. All rights reserved.
//

#import "MOProdectHeadView.h"
#import "Masonry.h"

@interface MOProdectHeadView ()

@property(nonatomic, strong) UIImageView * icon;
@property(nonatomic, strong) UIImageView * textImage;

@end

@implementation MOProdectHeadView

- (instancetype)initWithFrame:(CGRect)frame {
    
    if ([super initWithFrame:frame]) {
        
        self.icon = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"product_img_logo_nor.png"]];
        self.textImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"product_text_logo_nor.png"]];
        
        [self addSubview:self.icon];
        [self addSubview:self.textImage];
    }
    return self;
    
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.equalTo(self);
        make.bottom.equalTo(self).offset(-self.bounds.size.height * 0.5);
        
    }];
    
    [self.textImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.equalTo(self);
        make.top.equalTo(self.icon).offset(self.icon.bounds.size.height);
        
    }];
}

@end
